package com.hy.search.web;

import com.hy.common.vo.PageResult;
import com.hy.search.pojo.Goods;
import com.hy.search.pojo.SearchRequest;
import com.hy.search.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

@Controller
public class SearchController {
    @Autowired
    private SearchService searchService;
    @PostMapping("page")
    public ResponseEntity<PageResult<Goods>> search(@RequestBody SearchRequest searchRequest){

        return ResponseEntity.ok(searchService.search(searchRequest));

    }
}
